package com.wwj.auction.login.controller;

import com.wwj.auction.common.result.R;
import com.wwj.auction.login.entity.vo.TransFlowVo;
import com.wwj.auction.login.service.TransFlowService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wwj
 * @since 2021-08-10
 */
@RestController
@RequestMapping("/login/transFlow")
@Slf4j
@Api("交易流水")
public class TransFlowController {

    @Autowired
    private TransFlowService transFlowService;

    /**
     * 获取交易流水列表
     *
     * @return
     */
    @GetMapping("/list/{userId}")
    public R list(@PathVariable("userId") Integer userId) {
        List<TransFlowVo> transFlowList = transFlowService.listForTransFlowVo(userId);
        return R.ok().data("list", transFlowList);
    }
}

